<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;

class CompanyModel extends AbstractBaseModel
{
    use SoftDeletes;

    protected $table = 'company';

    const TYPE_PERSON = 1;
    const TYPE_ENTERPRISE = 2;

    const TYPE_LIST = [
        self::TYPE_ENTERPRISE =>'企业',
        self::TYPE_PERSON =>'个人',
    ];

    const VERIFY_WAIT = 1;//正常
    const VERIFY_WAITING = 0;//待审核
    const VERIFY_REJECT = 2;//拒绝

    const VERIFY_LIST = [
        self::VERIFY_WAIT=>'正常',
        self::VERIFY_WAITING=>'待审核',
        self::VERIFY_REJECT=>'审核拒绝',
    ];

    const DEFAULT_LOGO = 'https://oss.charityzimi.cn/head_pic/28lvCEV89wF633BsRuR3SyL7a3jbfds6FHarYNNF.png';//默认企业logo
    const DEFAULT_CONTACT_PERSON = 'https://oss.charityzimi.cn/head_pic/Nmby5rgCW9X5bGNtYZVR1iXFqGgVnBO5aWrwMtkT.png';//默认联系人头像

    public function logoUrl()
    {
        if ($this->company_logo && $this->cur_type == self::TYPE_ENTERPRISE) {
            return $this->company_logo;
        }
        return self::DEFAULT_LOGO;
    }
    public function contactPersonUrl()
    {
        if ($this->contact_person_avatar){
            return $this->contact_person_avatar;
        }
        return self::DEFAULT_CONTACT_PERSON;
    }

}
